// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
// http://www.zhengzhong.net/
//
// $Id: base.hpp 318 2009-03-02 14:03:21Z heavyzheng $
//

#ifndef ZZHENG_XML_XSLT_LIBXSLT_BASE_HPP_20090209__
#define ZZHENG_XML_XSLT_LIBXSLT_BASE_HPP_20090209__

#include <zzheng/xml/config.hpp>
#include <zzheng/utility/phoenix_singleton.hpp>
#include <zzheng/xml/dom/libxml2/base.hpp>

#ifdef ZZHENG_MSVC
#  pragma warning(push)
#  pragma warning(disable: 4511 4512) // noncopyable warnings
#endif // ZZHENG_MSVC

namespace zzheng {
namespace xml {
namespace xslt {
namespace libxslt_ {

    //! This class manages libxml2's global resources. It is implemented as a phoenix singleton.
    class globals: public phoenix_singleton<globals> {

        friend class phoenix_singleton<globals>;

    private:

        //! Constructor: initializes the global resources of libxml2.
        explicit globals();

        //! Destructor: releases the global resources of libxml2.
        ~globals();

    }; // class globals

    ////////////////////////////////////////////////////////////////////////////////////////////////

    //! The base class for all libxslt-related classes. The constructor of this class ensures that
    //! the globals singleton is created by requesting a reference to the singleton instance. This
    //! class should be derived (private) by classes who require that all libxslt resources be
    //! initialized.
    class base: private zzheng::xml::dom::libxml2_::base {

    protected:

        //! Protected default constructor for subclasses.
        explicit base();

    }; // class base

} // namespace zzheng::xml::xslt::libxslt_
} // namespace zzheng::xml::xslt
} // namespace zzheng::xml
} // namespace zzheng

#ifdef ZZHENG_MSVC
#  pragma warning(pop) // noncopyable warnings
#endif // ZZHENG_MSVC


#endif // ZZHENG_XML_XSLT_LIBXSLT_BASE_HPP_20090209__


